<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!--INSERT INTO wl_cust_code values(1,0,'a',null,'A','remark',0);//src="../dojo/dojo-release-1.0.0/dojo/dojo.js" 
INSERT INTO Wl_customer  values(0,'本公司','0',null,null,null,null,null,'0','0','0','0','0','0','0',null,'0','0',0,'0',null,'0','0','1','1');-->
<title>SplitContainer Demo</title>
     <style type="text/css">
            @import "../dojo/dojo-release-1.0.0/dijit/themes/tundra/tundra.css";
            @import "../dojo/dojo-release-1.0.0/dojo/resources/dojo.css";
            @import "../dojo/dojo-release-1.0.0/dojox/grid/_grid/tundraGrid.css";
            @import "../dojo/dojo-release-1.0.0/dojox/grid/_grid/Grid.css";
            @import "../js/wlProject.css";
	
      </style>
      <script type="text/javascript" src="../dojo/dojo-release-1.0.0/dojo/dojo.js"  
                djConfig="parseOnLoad: true, isDebug: true,locale: 'zh-cn', extraLocale: ['zh-TW', 'fr']"></script>
      <script>
    
            dojo.require("dojo.data.ItemFileWriteStore");
            dojo.require("dijit.layout.SplitContainer");
            dojo.require("dijit.layout.ContentPane");
            dojo.require("dijit.Tree");
            dojo.require("dojo.parser");
            dojo.require("dijit._tree.dndSource");
            dojo.require("dijit.layout.TabContainer");
            dojo.require("dijit.form.Button");
            dojo.require("dojox.grid.Grid");
            dojo.require("dojox.grid._data.model");
            dojo.require("dojo.i18n");
            dojo.require("dojox.validate._base");
            dojo.require("dijit.form.ValidationTextBox");
            dojo.require("dijit.form.TextBox");
            dojo.require("dijit.form.FilteringSelect");
            dojo.require("dojox.grid._data.dijitEditors");
            
            dojo.registerModulePath("mydojo", "../../../js/mydojo");
            dojo.require("mydojo.FilteringSelect");
            dojo.require("mydojo.ValidationTextBox");
            
     </script>
        
     <script type="text/javascript" src="../js/soapclient.js"></script>
     <script type="text/javascript" src="../js/wlProject.js"></script>
     <script type="text/javascript" >


         var url = getUrl()+ "services/CodeProductManageService";
         var placedata =  new Array();
         var placedata2 =  new Array();
         // var querydata = new Array();
         var detailRows = [];
         
         var data =new Array();
         var poptarts ={ label:'name',identifier:'eId',items:data};
         var popStore = new dojo.data.ItemFileWriteStore({data: poptarts});
          var pagenumber=1;
          var pagesize=4;
         var orderBy='0';
         var citySelectArray = new Array();
         var cityidSelectArray = new Array();
         var cityidSelectData = new Array();
         
 //按钮  
         var deletedata =new Array();
         var deletedata2 =new Array();
          //var itemt="区域";
         var selectNodeIdentity=0;//单击的树节点ID
         var selectNode;
          
  //验证方法要放在layout前面
         var formatNotNull = function(inDatum,inRowIndex){
               return dojox.validate.isText(inDatum, {minlength: 1}) ? inDatum : "<p style={color:red}> can not is null ! </p>";
      		 }
                        
         var transplaceID = function(inDatum,inRowIndex){
               return dojox.validate.isText(inDatum, {minlength: 1}) ? citySelectArray[inDatum] : "<p style={color:red}> can not is null ! </p>";
             }                
          
          
          var model = new dojox.grid.data.Table(null, placedata);
          var layout =[{type: 'dojox.GridRowView', width: '20px' },{
                       
             cells: [
                      [
                       { name: '选择', width: 3, styles: 'text-align: center;', editor: dojox.grid.editors.Bool },
                       { name: 'no', width: 2, get: function(inRowIndex){ return inRowIndex+1;} },
                        {name: '货物分类名称', field: 2,width: 20,editor: mydojo.ValidationTextBox , required:true ,maxLength:30,invalidMessage:'不能为空'},
                        {name: '货物分类编码', field: 3,width: 15, editor: mydojo.ValidationTextBox , required:true ,maxLength:30,invalidMessage:'不能为空'},
                        {name: '备注', field: 4,width: 35, editor: mydojo.ValidationTextBox , required:false ,maxLength:100,invalidMessage:'' },
                       
                       ]
                     ]
                                                                    }];
          model.observer(this);                                                          
          modelDatumChange = function(Datum, inRow, inField){
			dojo.byId("rowCount").innerHTML = ''; 
		 }                                                          
                                                                    
                                                                    
                                                                    
                                                                    
          var model2 = new dojox.grid.data.Table(null, placedata2);
        /* var layout2 =[{type: 'dojox.GridRowView', width: '2px' },{
                    noscroll: false,
                     cells: [
		                      [
		                       { name: '选择',field:0, styles: 'text-align: center;', editor: dojox.grid.editors.Bool },
		                       { name: 'no', get: function(inRowIndex){ return inRowIndex+1;} },
		                        {name: '货物编码', field:2,  editor: mydojo.ValidationTextBox , required:true ,maxLength:30,invalidMessage:'不能为空'},
		                        {name: '货物名称',field:3, editor: mydojo.ValidationTextBox , required:true ,maxLength:30,invalidMessage:'不能为空'}
		                      ]
		                    ]   
                },{
                noscroll: false,
		             cells: [
		                      [
		                       //{ name: '选择', width: 6, styles: 'text-align: center;', editor: dojox.grid.editors.Bool },
		                       //{ name: 'no', width: 2, get: function(inRowIndex){ return inRowIndex+1;} },
		                       // {name: '货物编码', field:2,width: 15, editor: dojox.grid.editors.Input },
		                       // {name: '货物名称',field:3, width: 15,editor: dojox.grid.editors.Input },
		                        {name: '规格', field:4, editor: mydojo.ValidationTextBox , required:false ,maxLength:30,invalidMessage:'' },
		                        {name: '型号', field:5, editor: mydojo.ValidationTextBox , required:false ,maxLength:30,invalidMessage:'' },
		                        {name: '计量单位',field:6, editor: dojox.grid.editors.Dijit,editorClass: "dijit.form.FilteringSelect", options:["公斤", "斤", "千米","厘米"], values:["", "", "",""]},
		                        {name: '价格',field:7, editor: dojox.grid.editors.Dijit, editorClass: "dijit.form.NumberTextBox", constraint: {min:0,max:2E16,places:0} },
		                      	{name: '重量',field:8,editor: dojox.grid.editors.Dijit, editorClass: "dijit.form.NumberTextBox", constraint: {min:0,places:0}},
		                        {name: '体积', field:9,editor: dojox.grid.editors.Dijit, editorClass: "dijit.form.NumberTextBox", constraint: {min:0,max:2E16,places:0}},
		                        {name: '标准', field:10,editor: mydojo.ValidationTextBox , required:false ,maxLength:30,invalidMessage:'' },
		                        {name: '特殊要求',field:11,editor: mydojo.ValidationTextBox , required:false ,maxLength:30,invalidMessage:'' },
		                        {name: '库位',field:12, editor: mydojo.FilteringSelect, options:["1", "2", "3","4"] , values:["", "", "",""] },
		                        {name: '备注',field:13,  editor: mydojo.ValidationTextBox , required:false ,maxLength:100,invalidMessage:''  }
	                          ]
	                        ]                      
                 }];                */   
             
                 
                  var layout2 =[{type: 'dojox.GridRowView', width: '2px' },{
                    
                     cells: [
		                      [
		                        { name: '选择', width:3, styles: 'text-align: center;', editor: dojox.grid.editors.Bool },
		                        {name: '货物编码', field:2,width:10, editor: mydojo.ValidationTextBox , required:true ,maxLength:30,invalidMessage:'不能为空'},
		                        {name: '货物名称',field:3, width: 20, editor: mydojo.ValidationTextBox , required:true ,maxLength:30,invalidMessage:'不能为空'},
		                        {name: '规格', field:4,width: 15, editor: mydojo.ValidationTextBox , required:false ,maxLength:30,invalidMessage:'' },
		                        {name: '型号', field:5,width: 15, editor: mydojo.ValidationTextBox , required:false ,maxLength:30,invalidMessage:'' },
		                        {name: '计量单位',field:6, width: 8, editor: dojox.grid.editors.FilteringSelect, options:["公斤", "斤", "千米","厘米"] },
		                        {name: '价格',field:7, width: 8,editor: dojox.grid.editors.Dijit, editorClass: "dijit.form.NumberTextBox", constraint: {min:0,max:2E16,places:4} }
		                      	
                          ],[
                            { name: '序号',  styles: 'text-align: center;',width:3, get: function(inRowIndex){ return inRowIndex+1;} },
		                        {name: '库位',field:12,width: 10, editor:dojox.grid.editors.FilteringSelect, options:["1", "2", "3","4"] },
		                        {name: '标准', field:10,width: 15,editor: mydojo.ValidationTextBox , required:false ,maxLength:30,invalidMessage:'' },
		                        {name: '特殊要求',field:11,width: 15,editor: mydojo.ValidationTextBox , required:false ,maxLength:30,invalidMessage:'' },
		                        {name: '备注',field:13, width: 10, editor: mydojo.ValidationTextBox , required:false ,maxLength:100,invalidMessage:''  },
	                          {name: '重量',field:8,width: 8,editor: dojox.grid.editors.Dijit, editorClass: "dijit.form.NumberTextBox", constraint: {min:0,places:4}},
		                        {name: '体积', field:9,width: 8,editor: dojox.grid.editors.Dijit, editorClass: "dijit.form.NumberTextBox", constraint: {min:0,max:2E16,places:4}}
		                        ]
		                    ]   
                }];    
                 
     model2.observer(this);                                                          
          modelDatumChange2 = function(Datum, inRow, inField){
			dojo.byId("rowCount2").innerHTML = ''; 
		 }                                                       
                 
                                                              
//保存列表
                   
  addRow = function(){
          	codegrid.addRow([false,0,"","",""],codegrid.model.getRowCount());
	        //dojo.byId("rowCount").innerHTML = '新增记录'; 
	         } 
  addRow2 = function(){
          	productgrid.addRow([false,0,"","","","","","","","","","","",""],productgrid.model.getRowCount());
	        //dojo.byId("rowCount2").innerHTML = '新增记录'; 	
	         } 
	         
  function call_funUpd() {
   
           var s = codegrid.selection.getSelected();
           //var url = getUrl()+ "services/CodeProductManageService";
           for(var i=0;i<s.length;i++){
             var ii=s[i];
             var thisCell=codegrid.model.data[ii];
             var padd = new SOAPClientParameters2();
             var codevo=new Object();
             codevo.id=thisCell[1];
             codevo.parCode=selectNodeIdentity;
             codevo.customerID=1;
             codevo.customerName='%';//
             codevo.sno='%';
             if(dojox.validate.isText(thisCell[2], {minlength: 1})){codevo.name=thisCell[2];}else{continue;}
             if(dojox.validate.isText(thisCell[3], {minlength: 1})){codevo.code=thisCell[3];}else{continue;}
             if(dojox.validate.isText(thisCell[4], {minlength: 1})){codevo.remark=thisCell[4];}else{continue;}
             if(thisCell[1]==0){//新增的记录
                padd.add('WlCustCodeVO',codevo);
                SOAPClient.invoke(url, "createCode", padd, false,  function GetEnu_callBack(ul, soapResponse){
                codegrid.model.setDatum(ul,i,1);
                });
	         }else{//修改的记录
                padd.add('WlCustCodeVO',codevo);
                SOAPClient.invoke(url, "updateCode", padd, false,  function GetEnu_callBack(ul, soapResponse){
                });
	         }
          }
//提交删除的记录？
          for(var i=0;i<deletedata.length;i++){
               var pdel = new SOAPClientParameters();      
               pdel.add('id',deletedata[i]);
               SOAPClient.invoke(url, "deleteCode", pdel, false,  function GetEnu_callBack(ul, soapResponse){
	             
	           });
          }
          //codegrid.updateRow();
          deletedata=new Array();
          dojo.byId("rowCount").innerHTML = '保存完毕！'; 
   }
          
   function call_funUpd2() {
  
           var s = productgrid.selection.getSelected();
           //var url = getUrl()+ "services/CodeProductManageService";
           for(var i=0;i<s.length;i++){
             var ii=s[i];
             var thisCell=productgrid.model.data[ii];
             var padd = new SOAPClientParameters2();
             var productvo=new Object();
             productvo.id=thisCell[1];
            /* alert("1:"+thisCell[1]);
              alert("2:"+thisCell[2]);
               alert("3:"+thisCell[3]);
                alert("4:"+thisCell[4]);
                 alert("5:"+thisCell[5]);
                  alert("6:"+thisCell[6]);
                   alert("7:"+thisCell[7]);
                    alert("8:"+thisCell[8]);
                     alert("9:"+thisCell[9]);
                      alert("10:"+thisCell[10]);
                       alert("11:"+thisCell[11]);
                        alert("12:"+thisCell[12]);
                         alert("13:"+thisCell[13]);*/
             if(dojox.validate.isText(thisCell[2], {minlength: 1})){productvo.productCode=thisCell[2];//用户可自定义，用户如果不定义，则系统会自动定义为名称的首字拼音
             }else{continue;}
             if(dojox.validate.isText(thisCell[3], {minlength: 1})){productvo.equName=thisCell[3];}else{continue;}
             if(dojox.validate.isText(thisCell[4], {minlength: 1})){productvo.productType=thisCell[4];}else{continue;}
             if(dojox.validate.isText(thisCell[5], {minlength: 1})){productvo.model=thisCell[5];}else{continue;}
             if(dojox.validate.isText(thisCell[6], {minlength: 1})){productvo.unit=thisCell[6];}else{continue;}
             if(dojox.validate.isInRange(thisCell[7],{max:9999999, min:0})){productvo.price=thisCell[7];}else{continue;}
             if(dojox.validate.isInRange(thisCell[8],{max:9999999, min:0})){productvo.weight=thisCell[8];}else{continue;}
             if(dojox.validate.isInRange(thisCell[9],{max:9999999, min:0})){productvo.volume=thisCell[9];}else{continue;}
             if(dojox.validate.isText(thisCell[10], {minlength: 1})){productvo.level=thisCell[10];}else{continue;}
             if(dojox.validate.isText(thisCell[11], {minlength: 1})){productvo.request=thisCell[11];}else{continue;}
             if(dojox.validate.isText(thisCell[12], {minlength: 1})){productvo.packID=thisCell[12];}else{continue;}
             if(dojox.validate.isText(thisCell[12], {minlength: 1})){productvo.packName=thisCell[12];}else{continue;}
             if(dojox.validate.isText(thisCell[13], {minlength: 1})){productvo.remark=thisCell[13];}else{continue;}
             //alert(selectNodeIdentity);
             productvo.codeid=selectNodeIdentity;
             productvo.codeName=0;
          if(thisCell[1]==0){//新增的记录
                padd.add('WlCustProductVO',productvo);
                SOAPClient.invoke(url, "createProduct", padd, false,  function GetEnu_callBack(ul, soapResponse){
                productgrid.model.setDatum(ul,i,1);
                });
          }else{//修改的记录
                padd.add('WlCustProductVO',productvo);
                SOAPClient.invoke(url, "updateProduct", padd, false,  function GetEnu_callBack(ul, soapResponse){
                });
             }
		  }
//提交删除的记录？
              for(var i=0;i<deletedata2.length;i++){
                   var pdel = new SOAPClientParameters();      
                   pdel.add('id',deletedata[i]);
                 SOAPClient.invoke(url, "deleteProduct", pdel, false,  function GetEnu_callBack(ul, soapResponse){
                 
                });
              }
              productgrid.updateRow();
              deletedata2=new Array();
               dojo.byId("rowCount2").innerHTML = '保存完毕！'; 
   }
          
          
   function removeSelectedRows(){
     
           var s = codegrid.selection.getSelected();
           for(var i=0;i<s.length;i++){ 
             var ii=s[i];
             var thisCell=codegrid.model.data[ii];
             if(thisCell[1]!=0){//要删除的记录
               deletedata.splice(deletedata.length,0,thisCell[1]);
               
             }
           }    
           codegrid.removeSelectedRows();
           //if(deletedata.length>0)dojo.byId("rowCount").innerHTML = '删除记录'; 
    }   
 function removeSelectedRows2(){
     
           var s = productgrid.selection.getSelected();
           for(var i=0;i<s.length;i++){ 
             var ii=s[i];
             var thisCell=productgrid.model.data[ii];
             if(thisCell[1]!=0){//要删除的记录
               deletedata2.splice(deletedata2.length,0,thisCell[1]);
             }
           }    
           productgrid.removeSelectedRows();
          // if(deletedata2.length>0)dojo.byId("rowCount2").innerHTML = '删除记录'; 
    }    
        
  var myModel = new dijit.tree.ForestStoreModel({
  				store: popStore,
  				rootId: "0",
  				rootLabel: "分类",
  				childrenAttrs: ["children"]
  			});        
  var _tree=dijit.byId("tree");      
  function getTreeNodes(codeID,custID,chitem,layerInt,layerSum){//首层layerInt=0
             var pl = new SOAPClientParameters();
             pl.add('codeID',codeID) ;
             pl.add('custID',custID) ;
             pl.add('pageNumber',pagenumber) ;
             pl.add('pageSize',pagesize) ;
             pl.add('orderBy',orderBy) ;
             SOAPClient.invoke(url, "getCodeByParCodeIDAndCustID", pl, false,  function GetEnu_callBack(ul, soapResponse){
               var pInfo = {
                   					parent: chitem,		
                   					attribute: "children"	
                   		};
               if(ul!=null && ul.length>0 ){
                     
                     for(var i = 0; i < ul.length; i++){		
                                  var ulo=ul[i];
                                  var newitem=popStore.newItem({name: ulo["ns:name"],type:ulo["ns:parCode"] ,eId:ulo["ns:id"],haveChild:"0"}, pInfo);//haveChild=0初始，1有子结点，2无子结点
                                  if(layerInt<layerSum)getTreeNodes(ulo["ns:id"],custID,newitem,layerInt+1,layerSum);
                                  
                             }
                      if(chitem!=null){
                            popStore.setValue(chitem,"haveChild","1"); 
                            var node = dijit.byId("tree")._itemNodeMap[chitem.eId];
                            node._updateItemClasses(node.item);
                            //node.expand();       
                      }
                             
                }else{
                    popStore.setValue(chitem,"haveChild","2");  
                }       
          });
        
        }
   function expandAllChildrenNode(tree,treeNode,layerInt,layerSum){
		      //treeNode.expand();
		      tree._expandNode(treeNode);
          var childrenArray=treeNode.getChildren();
          for (var i=0; i<childrenArray.length; i++){//begin	
             if(layerInt<layerSum) expandAllChildrenNode(tree,childrenArray[i],layerInt+1,layerSum);
             //if(layerInt==layerSum&&tree.model.mayHaveChildren(childrenArray[i].item))childrenArray[i].
             if(layerInt==layerSum)childrenArray[i]._updateItemClasses(childrenArray[i].item);
          }
        }              
        
   
   
   function init(){
        //添加分类第一层结点        
		    var _tree=dijit.byId("tree");  
		    getTreeNodes(0,1,null,0,2);
		    expandAllChildrenNode(_tree,_tree.rootNode,0,1);
		    //_tree.startup();
        
                
//初始化列表----begin
//初始化列表----end
         dojo.connect(dijit.byId("tree"), "_onExpandoClick", function(message){
                       // _expandNode
                       var node = message.node;
                       var ch2node=node.getChildren();
                       for (var i=0; i<ch2node.length; i++){	
                       //alert(ch2node.length);
                       if(ch2node[i].getChildren().length==0&&ch2node[i].item.haveChild=="0"){
                         var ch2item =ch2node[i].item;
                         getTreeNodes(ch2item.eId,1,ch2item,0,1);
                       }
                      
                      }
             	 
            });   
//查询列表----begin
             dojo.connect(_tree, "onClick", function(item,node){
             //判断哪个tab在显示
             	    selectNode=node;
                    selectNodeIdentity = _tree.store.getIdentity(item);
                    var p0 = new SOAPClientParameters();
                    //alert(mainTabContainer.selectedChildWidget.id);
              if(mainTabContainer.selectedChildWidget.id=='codePane'){
                    //code
                    placedata = new Array();
                    p0.add('codeID',item["eId"]);
                    p0.add('custID',1) ;
                    p0.add('pageNumber',0) ;
      				p0.add('pageSize',0) ;
      				p0.add('orderBy',"%") ;
                    SOAPClient.invoke(url, "getCodeByParCodeIDAndCustID", p0, false,  function GetEnu_callBack(ul, soapResponse){   
                    for(var i = 0; i < ul.length; i++){		
                      var items = new Array();
                      var ulo=ul[i];
                        items[0] = false;
                        items[1] = ulo["ns:id"];
                        items[2] = ulo["ns:name"];
                        items[3] = ulo["ns:code"];
                        items[4] = ulo["ns:remark"];
                        placedata[i]=items;
                    }                
                });       
                model.setData(placedata);
                codegrid.selection.clear();
                /* var titles=node.item["name"];
                var parentNodes=node;
                while(parentNodes.getParent()!= null&& parentNodes.getParent()["id"]!="tree"){
                      parentNodes=parentNodes.getParent();
                      titles=parentNodes.item["name"]+' '+titles;
                };
                dojo.byId("placetitle").innerHTML = titles +"";*/
                deletedata =new Array();
                
             }else{
                //product
                    placedata2 = new Array();
                    p0.add('code','%');
                    p0.add('name','%');
                    p0.add('type','%');
                    p0.add('model','%');
                    p0.add('codeId',item["eId"]);
                    p0.add('pageNumber',0) ;
      				p0.add('pageSize',0) ;
      				p0.add('orderBy',"%") ;
                    SOAPClient.invoke(url, "getProductsBy", p0, false,  function GetEnu_callBack(ul, soapResponse){   
                    for(var i = 0; i < ul.length; i++){		
                      var items = new Array();
                      var ulo=ul[i];
                        items[0] = false;
                        items[1] = ulo["ns:id"];
                        items[2] = ulo["ns:productCode"];
                        items[3] = ulo["ns:equName"];
                        items[4] = ulo["ns:productType"];
                        items[5] = ulo["ns:model"];
                        items[6] = ulo["ns:unit"];
                        items[7] = ulo["ns:price"];
                        items[8] = ulo["ns:weight"];
                        items[9] = ulo["ns:volume"];
                        items[10] = ulo["ns:level"];
                        items[11] = ulo["ns:request"];
                        items[12] = ulo["ns:packID"];
                        items[13] = ulo["ns:remark"];
                        placedata2[i]=items;
                    }                
                });       
                model2.setData(placedata2);
                productgrid.selection.clear();
                deletedata2 =new Array();
              }  
           });  
           //查询列表----end
  }//END INIT
            
           dojo.addOnLoad(init);
           

          //查询按钮
          
          
function querybutton(){
          //根据终点树查询的范围内进行查询
              //var url =getUrl()+  "services/BasicManageService";
              var p = new SOAPClientParameters2();
              var querycodevo=new Object();
                querycodevo.parCode=selectNodeIdentity;
                querycodevo.id=0 ;
			    querycodevo.code = '%'+querycode.getDisplayedValue()+'%';
				querycodevo.customerID=1 ;
				//querycodevo.sno = '%';
				querycodevo.name = '%'+queryname.getDisplayedValue()+'%';
				querycodevo.remark = '%'+queryremark.getDisplayedValue()+'%';
              p.add('WlCustCodeVO',querycodevo) ;
              //p.add('pageNumber',0) ;
      		  //p.add('pageSize',0) ;
      		  //p.add('orderBy','%') ;
              SOAPClient.invoke(url, "getCodeVO", p, false,  function GetEnu_callBack(ul, soapResponse){   
                     querydata=new Array();        
                     for(var i = 0; i < ul.length; i++){		
                      var items = new Array();
                      var ulo=ul[i];
                        items[0] = false;
                        items[1] = ulo["ns:id"];
                        items[2] = ulo["ns:name"];
                        items[3] = ulo["ns:code"];
                        items[4] = ulo["ns:remark"];
                      querydata[i]=items;
                    }                
                });       
                model.setData(querydata); 
         }
           
function querybutton2(){
          //根据终点树查询的范围内进行查询
              var p = new SOAPClientParameters();
              p.add('code','%'+querycode2.getDisplayedValue()+'%') ;
              p.add('name','%'+queryname2.getDisplayedValue()+'%') ;
              p.add('type','%'+querytype2.getDisplayedValue()+'%') ;
              p.add('model','%'+querymodel.getDisplayedValue()+'%') ;
              p.add('codeid',selectNodeIdentity) ;
              p.add('pageNumber',0) ;
      		  p.add('pageSize',0) ;
      		  p.add('orderBy','%') ;
              SOAPClient.invoke(url, "getProductsBy", p, false,  function GetEnu_callBack(ul, soapResponse){   
                     querydata=new Array();        
                     for(var i = 0; i < ul.length; i++){		
                      var items = new Array();
                      var ulo=ul[i];
                        items[0] = false;
                         items[1] = ulo["ns:id"];
                        items[2] = ulo["ns:productCode"];
                        items[3] = ulo["ns:equName"];
                        items[4] = ulo["ns:productType"];
                        items[5] = ulo["ns:model"];
                        items[6] = ulo["ns:unit"];
                        items[7] = ulo["ns:price"];
                        items[8] = ulo["ns:weight"];
                        items[9] = ulo["ns:volume"];
                        items[10] = ulo["ns:level"];
                        items[11] = ulo["ns:request"];
                        items[12] = ulo["ns:packName"];
                      querydata[i]=items;
                    }                
                });       
                model2.setData(querydata); 
         }
           
           
// document.split1.style.width=screen.availWidth; 
//document.split1.style.height=screen.availHeight; 
             
</script>
</head>
<body class="tundra">
       
	
	 <div dojoType="dijit.layout.SplitContainer"   orientation="horizontal"  sizerWidth="7" activeSizing="false"	style="border: 1px solid #bfbfbf; width: 1260px; height: 845px;"  >
		
         <div dojoType="dijit.layout.ContentPane" id="treePane"  sizeMin="20" sizeShare="20"   >
                     
                <div id="tree" showRoot="true" persist="false" dojoType="dijit.Tree"  store="popStore" labelAttr="name"  childrenAttr="children" query="{type:0}" model="myModel" ></div> 
         </div>
         
        <div dojoType="dijit.layout.ContentPane" sizeMin="50" sizeShare="50"  >
        
        	<div jsId="mainTabContainer" dojoType="dijit.layout.TabContainer"  styles="width: 70%; height: 100%;"  >
        	
        	<div id="codePane" dojoType="dijit.layout.ContentPane" title="货物分类编码" >
	           		<div id="queryDiv" style="margin-right: 30px; width:100%; height: 23%; display:none;" >
	                        <table align="center" width=86% class="queryTable"  >
	                        <tr height="3" ></tr>
						          <tr align="center"><td >请输入查询条件：</td><td></td></tr> <tr height="6" ></tr>
						          <tr align="center" >
						               <td>货物分类名称：<input type="text" jsId="queryname"   dojoType="dijit.form.TextBox"  /></td>
						               <td>货物分类编码：<input type="text" jsId="querycode"   dojoType="dijit.form.TextBox"  /></td>
						          </tr><tr height="6" ></tr>
						          <tr align="center" >
	                                   <td colspan="2" >备注：<input type="text" jsId="queryremark"   dojoType="dijit.form.TextBox"  /></td>
	                               </tr>    
	                       <tr height="3" ></tr>
	                       <tr align="center"><td></td><td ><a onclick="querybutton();"><img src="../image/332.gif" height="20" width="20" border="0">确 定</a></td></tr> <tr height="6" ></tr>
						    </table>
	            </div>
	          	<div align="right">
	          		<a onclick="querydisplay();"><img src="../image/332.gif" height="20" width="20" border="0">查询</a>
			        <a onclick="addRow();"><img src="../image/371.gif" height="20" width="20" border="0">新 增</a>
			        <a onclick="removeSelectedRows();"><img src="../image/808.gif" height="20" width="20" border="0">删 除</a>
			        <a onclick="call_funUpd();"><img src="../image/334.gif" height="20" width="20" border="0">保 存</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
			     </div>   
	        
	         <div  style="{width:100%; height: 1%; }" > </div>
	         <div id="rowCount"></div>
	         <div id="codegrid"  dojoType="dojox.Grid"  autoWidth="false" style="{width:100%;height:85%}" 	jsId="codegrid"	model="model" structure="Layout" singleClickEdit="true"  ></div>
	      </div>

          <div id="productPane" dojoType="dijit.layout.ContentPane" title="货物编码"  selected="true" >
	           	<div id="queryDiv2" style="margin-right: 30px;  height: 23%; display:none;" >
	                        <table align="center" width=86% class="queryTable"  >
	                        <tr height="3" ></tr>
						          <tr align="center"><td >请输入查询条件：</td><td></td></tr> <tr height="6" ></tr>
						          <tr align="center" >
						               <td>货物编码：<input type="text" jsId="querycode2"  dojoType="dijit.form.TextBox"  /></td>
						               <td>货物名称：<input type="text"  jsId="queryname2"   dojoType="dijit.form.TextBox"  /></td>
						          </tr><tr height="6" ></tr>
						          <tr align="center" >
						               <td>规格：<input type="text" jsId="querytype2"   dojoType="dijit.form.TextBox"  /></td>
						               <td>型号：<input type="text" jsId="querymodel"   dojoType="dijit.form.TextBox"  /></td>
						          </tr><!-- tr height="6"  autoWidth=  ></tr>
						          <tr align="center" >
						               <td>计量单位：<input type="text" jsId="queryunit"   dojoType="dijit.form.TextBox"  /></td>
						               <td>价格：<input type="text" jsId="queryprice"   dojoType="dijit.form.TextBox"  /></td>
						          </tr><tr height="6" ></tr>
						          <tr align="center" >
						               <td>重量：<input type="text" jsId="queryweight"   dojoType="dijit.form.TextBox"  /></td>
						               <td>体积：<input type="text" jsId="queryvolume"   dojoType="dijit.form.TextBox"  /></td>
						          </tr><tr height="6" ></tr>
						          <tr align="center" >
						               <td>标准：<input type="text" jsId="querylevel"   dojoType="dijit.form.TextBox"  /></td>
						               <td>特殊要求：<input type="text" jsId="queryrequest"   dojoType="dijit.form.TextBox"  /></td>
						          </tr><tr height="6" ></tr>
						          <tr align="center" >
						               <td>库位：<input type="text" jsId="querypack"   dojoType="dijit.form.TextBox"  /></td>
						               <td>备注：<input type="text" jsId="queryremark"   dojoType="dijit.form.TextBox"  /></td-->
						   <tr height="3" ></tr>
	                       <tr align="center"><td></td><td ><a onclick="querybutton2();"><img src="../image/332.gif" height="20" width="20" border="0">确 定</a></td></tr> <tr height="6" ></tr>
						    </table>
	            </div>	
	           
	          	<div align="right">
	          		<a onclick="querydisplay('queryDiv2');"><img src="../image/332.gif" height="20" width="20" border="0">查询</a>
			        <a onclick="addRow2();"><img src="../image/371.gif" height="20" width="20" border="0">新 增</a>
			        <a onclick="removeSelectedRows2();"><img src="../image/808.gif" height="20" width="20" border="0">删 除</a>
			        <a onclick="call_funUpd2();"><img src="../image/334.gif" height="20" width="20" border="0">保 存</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
			     </div>   
	        
	      
	         <div id="rowCount2"></div>
	   <div style="{width:100%;height:90%;}" >
	         <div id="productgrid"  dojoType="dojox.Grid" autoWidth="false"  jsId="productgrid"	model="model2"  structure="layout2" singleClickEdit="true" elasticView="3" ></div>
	      </div></div>
      </div> 
       </div>  
 </div>
</body></html>
